import postDownload from "../../utils/download";
import request from "@/utils/request";

export function getOrderList(params) {
  return request({
    url: "/h5/order/list",
    method: 'get',
    params: params
  })
}

/**
 * 获取结算单列表
 */
export const getSettlementList = (params) => {
  return request({
    url: '/h5/settlement/list',
    method: 'GET',
    params: params
  });
}

/**
 * 获取结算单详情
 */
export const getSettlementDetail = (id) => {
  return request({
    url: '/h5/settlement/' + id,
    method: 'GET'
  });
}

/**
 * 添加结算单
 */
export const addSettlement = (data) => {
  return request({
    url: '/h5/settlement',
    method: 'post',
    data: data
  })
}
/**
 * 更新结算单
 */
export const updateSettlement = (data) => {
  return request({
    url: '/h5/settlement',
    method: 'put',
    data: data,
  })
}
/**
 * 删除结算单
 */
export const deleteSettlement = (id) => {
  return request({
    url: '/h5/settlement/' + id,
    method: 'delete',
  })
}

/**
 * 导出结算单
 * @param {Object} data
 */
export const exportExel = (data) => {
	postDownload("/h5/settlement/export",{id:data.id},data.shopName+data.start+'到'+data.end+'.xlsx')
}